﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.YG
{
    class Class20
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("健康专项检查"))
            {
                double max = ppa.Amount * 0.06;
                double c=    ppa.GetDutyTotalValue("健康专项检查金");

                if (max - c > double.Epsilon)
                {
                    da.Value = ppa.Amount * 0.01;
                }
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("重大疾病"))
            {
                da.Value = ppa.Amount - ppa.GetDutyTotalValue("健康专项检查金") - ppa.SchemePeriodActing.BasicPolicyPeriodActing.GetDutyTotalValue("年金给付");

                ppa.SchemePeriodActing.BasicPolicyPeriodActing.IsCurrentFinish = true;
                
            }
        }
    }
}
